package com.xuecheng.search.service;

import com.xuecheng.commons.model.dto.CoursePubIndexDto;
import com.xuecheng.commons.model.dto.PageRequest;
import com.xuecheng.commons.model.vo.CoursePubIndexVo;
import com.xuecheng.commons.model.vo.ResponseResult;

import java.io.IOException;

public interface SearchService {

    // 数据同步
    void MysqlToES(Long coursePubId) throws Exception;

    // 分页条件查询
    ResponseResult<CoursePubIndexVo> search(PageRequest pageRequest, CoursePubIndexDto dto) throws IOException;

    // 根据id查询课程(免费、收费)
    ResponseResult<CoursePubIndexVo> findById(String id) throws IOException;
    /**
     * 删除es文档
     * @param coursePubId
     * @throws IOException
     */
    void removeDocument(Long coursePubId) throws IOException;
}
